<?php
/*
 * Created on Oct 14, 2008
 *
 * Add the character.
 */
session_start();

if ( !isset($_SESSION['user']) ) {
	exit;
} 
 
require_once ("../server/dbconnect.php");

if (!isset($_POST['name'])) {
	die ("You need to enter a title");
}

// put the title in the db...
// database connection
$db = dbconnect();

$title = $_POST['name'];
 		
// the title insert sql query
$sql = "INSERT INTO titles".
        " ( id, name )" .
        " VALUES" .
        " ('', '$title')";
                
// insert the title
if(!$db->query($sql)) {
	$db->rollback();        	
	die ("Unable to add title.");
}        
$db->commit();

$db->disconnect();

header('Location: ../anime.php');
?>
